﻿using System.Text.RegularExpressions;

namespace SUNRPA.CONTROLS.IMPL.domain.constant {
    public class DefaultContents {
        //浏览器默认路径
        public const string IE_DEFAULT_PATH = @"C:\Program Files (x86)\Internet Explorer\iexplore.exe";
        public const string EDGE_DEFAULT_PATH = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe";
        public const string GOOGLE_DEFAULT_PATH = @"C:\Program Files\Google\Chrome\Application\chrome.exe";
        
        //序列化文件名称
        public const string SERIALIZE_GOLBLE_DATA = "globleData.rpa";
        public const string SERIALIZE_FLOWITEMS = "flowItems.rpa";
        
        //项目NS
        public const string PROJECT_NAME = "SUNRPA.CONTROLS.IMPL";
        public const string DEFAULT_PARAM_NAME = "param";
        public const string DEFAULT_ELE_NAME = "element";
        public const string GLOBLE_PARAM = "globleParam";
        public const string RUNNING_PARAM = "runningParam";
        public static  Regex PARAM_PATTERN = new Regex(@"\{[\[\]a-zA-Z0-9\+\-_\.\^\%~\(\)]+\}|\{[\{][\}]\}|\{[\{]\}|\{[\}]\}");
        
        //IAccessible接口的GUID
        public static Guid IID_IACCESSIBLE = new Guid("618736E0-3C3D-11CF-810C-00AA00389B71");
        //excelApplication的GUID
        public static Guid EXCEL_APPLICATION_ID = new Guid("00024500-0000-0000-C000-000000000046");


        public const string QUARTZ_SCHEDULE = "app_schedule";
        //用户目录变量名称，作为应用全局变量容器的key
        public const string USER_DIRS = "user_dirs";
        public static string USER_BASE_PATH = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "SUNRPA" +  Path.DirectorySeparatorChar;
        public static string LOG_BASE_PATH = USER_BASE_PATH + "log" + Path.DirectorySeparatorChar;
        public const string FUNCTION_TREE_NAME = "functionTree";

        //各种应用窗口的默认类名
        public const string GOOGLE_WIN_CLASS = "Chrome_WidgetWin";
        public const string GOOGLE_WIN_CLASS1 = "Chrome_RenderWidget";

        //浏览器插件中间程序服务名称
        public const string NAMED_PIPE_SERVER = "SUNRPA_BRIDGE";

        //浏览器插件方法定义
        public const string CATCH_ELE = "CatchElement";
        public const string OPEN_WEBPAGE = "OpenWebPage";
        public const string CLICK_ELE = "ClickEle";
        public const string INPUT_TEXT = "InputTextToEle";
        public const string SELECT_DDV = "SelectDropDownValue";
        public const string SELECT_DDV_BYINDEX = "SelectDropDownByIndex";
        public const string DOWNLOAD_BYURL = "DownloadByUrl";
        public const string SEARCH_LATEST_DOWNLOAD_ITEM = "SearchLatestDownloadItem";
        public const string ISDOWNLOAD_FINISHED = "IsDownloadFinished";
        public const string WAIT_ELE_SHOWUP = "WaitEleShowUp";
        public const string WAIT_ELE_DISAPPER = "WaitEleDisapper";
        public const string GET_FOCUS = "GetFocus";
        public const string GET_OPENED_WEBPAGE = "GetOpenedWebPage";
        
        public static Dictionary<string, string> RESERVEVARS = new Dictionary<string, string>() { 
            {"ESC", "ESC"},
            {"F1", "F1"},
            {"F2", "F2"},
            {"F3", "F3"},
            {"F4", "F4"},
            {"F5", "F5"},
            {"F6", "F6"},
            {"F7", "F7"},
            {"F8", "F8"},
            {"F9", "F9"},
            {"F10", "F10"},
            {"F11", "F11"},
            {"F12", "F12"},
            {"{", "{"},
            {"}", "}"},
            {"BACKSPACE", "BACKSPACE"},
            {"BS", "BS"},
            {"BKSP", "BKSP"},
            {"BREAK", "BREAK"},
            {"CAPSLOCK", "CAPSLOCK"},
            {"DELETE", "DELETE"},
            {"DOWN", "DOWN"},
            {"UP", "UP"},
            {"LEFT", "LEFT"},
            {"RIGHT", "RIGHT"},
            {"END", "END"},
            {"ENTER", "ENTER"},
            {"HELP", "HELP"},
            {"HOME", "HOME"},
            {"INSERT", "INSERT"},
            {"NUMLOCK", "NUMLOCK"},
            {"PGDN", "PGDN"},
            {"PGUP", "PGUP"},
            {"PRTSC", "PRTSC"},
            {"SCROLLLOCK", "SCROLLLOCK"},
            {"TAB", "TAB"},
            {"+", "+"},
            {"^", "^"},
            {"%", "%"}
        };
    }
}
